﻿package com.gengine.resource
{
    import com.gengine.resource.info.*;
    import flash.utils.*;

    public class ResByteManager extends Object
    {
        public static var _byteMap:Dictionary = new Dictionary();

        public function ResByteManager()
        {
            return;
        }// end function

        public static function addInfo(param1:ResourceInfo) : void
        {
            if (!_byteMap[param1.name])
            {
                _byteMap[param1.name] = param1;
            }
            return;
        }// end function

        public static function dispose(param1:Boolean = false) : void
        {
            var _loc_3:ResourceInfo = null;
            var _loc_2:* = getTimer();
            for each (_loc_3 in _byteMap)
            {
                
                if (_loc_3.bytesDisposeTime < _loc_2 || param1)
                {
                    _loc_3.clearCacheBytes();
                    delete _byteMap[_loc_3.name];
                }
            }
            return;
        }// end function

    }
}
